from rest_framework import serializers
from .models import Dept,Emp

#员工序列化器
class EmpSer(serializers.ModelSerializer):
    class Meta:
        model=Emp
        fields='__all__'
#部门序列化器
class DeptSer(serializers.ModelSerializer):
    emp_set = serializers.StringRelatedField(many=True)
    class Meta:
        model=Dept
        fields='__all__'

